package main

import (
	r "ansible-backend/redis_config"
	"flag"
	"fmt"
)

func GetEnvFromCmd() string {
	GetCmdEnv := flag.String("env", "nothing", "default nothing")
	flag.Parse()
	//fmt.Printf("%T\n", GetCmdEnv)
	//fmt.Println(*GetCmdEnv)
	if *GetCmdEnv == "nothing" {
		//fmt.Println("Usage: env\n")
		fmt.Println("Usage: xx.go  -env \"[test|online]\"")
	}
	CmdEnv := *GetCmdEnv
	return CmdEnv
}

func main() {

	//fmt.Println(r.R1.FullHost)
	Env := GetEnvFromCmd()
	var R2 r.RedisConfig
	R2 = r.GetRedisConf(Env)
	fmt.Println(R2.FullHost)

}
